package com.ppp.poi.web;

import com.ppp.poi.bean.base.AppResult;
import com.ppp.poi.bean.entity.User;
import com.ppp.poi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Wu Jin
 * @create 2020-01-19
 */
@RequestMapping
@RestController
public class LoginController {

  @Autowired
  private UserService userService;

  @RequestMapping("/login")
  public AppResult<User> login(String code, String platform) {
    User user = userService.login(code, platform);
    return new AppResult(user);
  }

  @RequestMapping("/logout")
  public AppResult logout(Integer id) {
    return null;
  }

}
